package com.pureut.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pureut.order.domain.SubcontractingOrder;
import com.pureut.order.dto.MaterialBomHalfDetailDto;
import com.pureut.order.dto.SubcontractingOrderDto;
import com.pureut.order.vo.*;

import java.sql.SQLException;
import java.util.List;

/***
 *
 * Author:C
 * Date:2022/12/02 9:57
 * @DESC
 */
public interface SubcontractingOrderService extends IService<SubcontractingOrder> {

    /**
     * 委外订单列表
     */
    List<SubcontractingOrderDto> getList(SubcontractingOrderVo subcontractingOrderVo);

    /**
     * 新增委外订单
     */
    boolean saveSubcontractingOrder(SubcontractingOrderVo subcontractingOrderVo) throws Exception;

    /**
     * 提交审核
     */
    boolean submitReview(Long id);

    /**
     * 上传合同
     */
    boolean uploadContract(SubcontractingOrderUploadContractVo subcontractingOrderUploadContractVo);

    /**
     * 撤销审核
     */
    boolean deleteReview(Long id);

    /**
     * 关结委外订单
     */
    boolean close(SubcontractingOrderVo subcontractingOrderVo);

    /**
     * 查看
     */
    SubcontractingOrderDto getView(Long id);

    /**
     * 修改
     */
    boolean updateSubcontractingOrder(SubcontractingOrderUpdateVo subcontractingOrderUpdateVo) throws SQLException;

    /**
     * 订单审核
     */
    boolean orderReview(OrderReviewVo orderReviewVo);

    /**
     * 合同审核
     * @param orderReviewVo
     * @return
     */
    boolean contractReview(OrderReviewVo orderReviewVo);

    /**
     * 委外入库回传委外订单（fegin调用）
     */
    boolean updateSubcontractingOrderData(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo);

    /**
     * 委外入库回传委外订单（撤销 fegin调用）
     * @param updateSubcontractingOrderDataVo
     */
    boolean updateSubcontractingOrderDataDelete(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo);

    /**
     * 委外退货回传委外订单
     * @param updateSubcontractingOrderDataVo
     * @return
     */
    boolean updateBackOrderData(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo);

    /**
     * 委外退货回传委外订单
     * @param updateSubcontractingOrderDataVo
     * @return
     */
    boolean updateBackOrderDataDelete(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo);

    /**
     * 委外订单新增查询bom明细数据及库存量
     */
    List<MaterialBomHalfDetailDto> getBomDetailList(long bomId);

    /**
     * 删除委外订单
     */
    boolean deleteSubcontractingOrder(String idStr);
}
